#include <iostream>
using namespace std;

class Object
{
public:
	Object(const char* s)
	{
		cout<<"Object()"<<" "<<s<<endl;//4打印s parent传过去的Parameter from Child!  8 打印o1  10 打印o2
	}
	~Object()
	{
		cout<<"~Object()"<<endl;
	}
};

class Parent : public Object
{
public:
	Parent(const char* s) : Object(s)//3先调用object  5调用parent
	{
		cout<<"Parent()"<<" "<<s<<endl;//6 打印Parameter from Child!
	}
	~Parent()
	{
		cout<<"~Parent()"<<endl;
	}
};

class Child : public Parent
{
protected:
	Object o1;//7 调用object
	Object o2;//9 调用 object
public:
	Child() : o2("o2"), o1("o1"), Parent("Parameter from Child!")//2先调用parent
	{
		cout<<"Child()"<<endl;//11 打印child()
	}
	~Child()
	{
		cout<<"~Child()"<<endl;
	}
};

int main()
{
	Child child;//1调用构造函数Childrun05();

	return 0;
}